"! "
Object subclass: UnitTest [
| currentTest |
<category: 'Library-Test'>
"! "
assert: boolean [
boolean ifFalse: [
	self error: #assert.
].  ]

"! "
assertFalse: boolean [
boolean ifTrue: [
	self error: #assert.
].  ]

"! "
run [
|pass count total|
total := 0.
count := 0.
self class methods do:[ :m |
	currentTest := m name asString.
	((currentTest from: 1 to: 4) = 'test') ifTrue: [
		pass := true.
		total := total + 1.
		'running ' print.
		(currentTest printWidth: 20) print.
		' - ' print.
		self try: [
			m executeWith: #() On: self.
		] except: [
			pass := false.
		].
		pass ifTrue: [ 
			'passed' printNl.
			count := count + 1.
		] ifFalse: [ 
			'failed' printNl. 
		]
	].
]. 
count print. '/' print. total print. ' passed' printNl.
^ total - count.
]

]

"! "
MetaObject subclass: MetaUnitTest [
<category: 'Library-Test'>
]

